The present invention relates to a control method of the control apparatus using a digital arithmetic processor for plant instrument control and/or various machine control, and specifically, to a control method for the multiple operating system in which plural operating systems are executed on an single processor.
In the control apparatus such as programmable logic controller (PLC) or numerical control apparatus (CNC) often used for plant instrument control and various machine controls, procedures for control logic are executed mainly. The functions other than procedures for control logic including the function for inputting the control logic into those control apparatus (development environment) and the functions for supervisory operation for the controlled status and for allowing the user to input the data in an interactive manner (human machine interface) are often realized by another apparatus such as personal computers (PC""s) connected outside the control apparatus (hereinafter referred to as user interface apparatus.) In case that those functions are embedded in a single apparatus, those functions are executed by the individual internal arithmetic processors. A technology related to this kind of apparatus is disclosed, for example, in Japanese Patent Application Laid-Open Number 9-62324 (1997).
The performance of PC""s used as a user interface apparatus has increased, and thus, computational power can be provided so that a single PC may cover the functions from the control logic operations to the development environment and the supervisory control up to a certain scale of control systems. However, in case of using a control apparatus comprising a PC-based hardware architecture supporting all of the system functions and applying an operating system (OS) generally used in PC""s, the operations of the programs and the device drivers other than the control programs may affect the operation of the control programs themselves.
There is such a technology that computer resources are shared in common with multiple OS""s and the functions generic to the individual OS""s are used by loading and running plural OS""s on an single CPU. Examples of this technology are disclosed in Japanese Patent Application Laid-Open Number 5-73340 (1993), Japanese Patent Application Laid-Open Number 5-27954 (1993) and Japanese Patent Application Laid-Open Number 5-151003 (1993).
Privileged instructions are executed generally in OS""s. Therefore, some disability occurring in one of OS""s may affects the execution of the other OS""s. However, this affect is not considered in the technology in which plural OS""s are loaded and ran simultaneously on a single computer, and hence, even by means of isolating the influence of the disabled OS over the other OS""s by emulating the disabled OS by the other OS""s as described in and Japanese Patent Application Laid-Open Number 5-1510003 (1993), the influence may be propagated onto the operations of both OS ""s in case that some disability may occur the OS emulating the disabled OS.
In the present invention, in order to solve the above problems, a software for controlling OS""s is loaded in order to switch the executing OS""s so that plural OS""s may be operated alternately. The control software is made executed on the OS with higher reliability, and the user interface program is made executed on the OS with rich functionality, and thus, OS""s each having specific characteristics are made executed on a single CPU. In responsive to the generation of interrupt or the request signal from OS""s or the software programs running on OS""s, this inter-OS control software stores and revises the context information of CPU operations (for example, register values of CPU), switches the memory spaces and restarts the OS operations in another context stored in past. In other words, the operation of the running OS is terminated and the operation of other OS""s is restarted. In addition, the inter-OS control software has a function which monitors start-stop operations of the running OS""S and controls the start-stop operation of the individual OS""s independently. Owing to this configuration, it will be appreciate that the hardware and software in the control apparatus can be partially initialized and that the disabled part can be automatically recovered, which leads to higher reliability of the total system.
Individual memory spaces occupied for the individual OS""s and a memory space shared and accessible commonly by plural OS""s are defined on the physical memory. Owing to this configuration, the individual memory spaces for the kernel and the programs are so defined that the interference among OS""s such as data destruction may be avoided and that the necessary data may be shared by the programs each executed on the difference OS""s. In addition the system has such a function that the program running on a certain OS waits for the event issued by the other OS""s and/or the programs running on those OS""s and the inter-OS control software notifies this event. Owing to this configuration, a communication function between the programs running on the different OS""s can be established.